package com.xrtn.job;

import com.xrtn.bean.TPatientTreatment;
import com.xrtn.service.ICommonService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by TreeJohn on 2018/11/23.
 */
public class OverTreatmentListJob {

    @Autowired
    private ICommonService commonService;

    public void work(){
        Map<String,Object> params = new HashMap<>();
        params.put("passHours", 24);
        List<TPatientTreatment> treatmentList = commonService.selectOverTreatment(params);
        for (TPatientTreatment treatment : treatmentList){
            treatment.setTreatmentState(2); // 已失效
            commonService.updateTreatment(treatment);
        }
    }
}
